<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>查看任务</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		
	</style>
</head>
<body>
	<%@ include file="include/topbar.jsp" %>

	<div class="container" style="margin-top: 60px">
			<div class="row">
				<jsp:include page="include/left.jsp" >
					<jsp:param value="goal" name="tag"/>
				</jsp:include>
				
	<div class="span9" >
		<ul class="breadcrumb" style="margin-bottom:0px;border-radius:3px 3px 0 0;margin-top:px">		
				<li >
					<h4><i class="icon-time"></i>&nbsp;任务列表</h4>
				</li>
				<c:if test="${role eq 'leader'}" var="result">
					<a href="addtask.jspx" class="pull-right"><i class="icon-plus"></i>添加任务</a>
				</c:if>
					
				
			</ul>
					
					
			<div class="row">
						<div class="narrow subproject" >
						<div class="span9">
							<ul class="breadcrumb" style="margin-bottom:0px;margin-top:15px;border-radius:3px 3px 0 0">
        						<li ><i class="icon-screenshot"></i>${curgoal.name }</li>
     						</ul>

							<div class="wall" style=";border-radius:0px">
								<p>${curgoal.desc }</p>
								<c:choose>
									<c:when test="${goalprogress eq 0}">
										<div class="progress progress-danger ">
											<div class="bar" style="width: 100%">目标未开始</div>
											
										</div>
										
									</c:when>
									<c:when test="${goalprogress eq 100 }">
										<div class="progress  progress-success">
											<div class="bar" style="width: 100%">目标已完成</div>
										</div>
									</c:when>
									<c:when test="${goalprogress ne 0 }">
										<div class="progress  ">
											<div class="bar" style="width: ${goalprogress}%">${goalprogress} %</div>
										</div>
									</c:when>
								</c:choose>
							</div>
							
							</div>	
						</div>
					</div>
		

				 		
				<c:forEach items="${tasklist }" var="task">
				
					<div class="accordion-group wall" style="margin-top:20px">
              <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#${task.id }">
                  <i class="icon-leaf"></i>&nbsp;${task.name }&nbsp;&nbsp;&nbsp;
                  <span >已完成:${task.progress} %</span>
                    
                  <span class="pull-right"><i class="icon-user"></i>&nbsp;${map[task.id] }</span>
                
                </a>
              </div>
              <div id="${task.id }" class="accordion-body  collapse  " style="height: 0px; ">
                <div class="accordion-inner">
               	<strong>创建时间</strong>： ${task.createTime}<br />
               	<strong>开始时间</strong>：${task.beginTime}<br />
               	 <strong>结束时间</strong>：${task.endTime}<br />
               	 <strong>任务级别</strong>：${task.level}<br />
               	<strong> 任务状态</strong>：${task.state}
                 <p>
                 	<strong>任务描述</strong>：${task.desc }
				</p>
				<c:choose>
						
						<c:when test="${task.progress eq 0}">
						<div class="progress progress-danger">
						<div class="bar "style="width: 100%;">未开始</div>
						</div>
						</c:when>
						
						<c:when test="${task.progress eq 100}">
						<div class="progress progress-success">
						<div class="bar "style="width: ${task.progress}%;">已全部完成</div>
						</div>
						</c:when>
						
						<c:when test="${task.progress ne 0}">
						<div class="progress">
						<div class="bar "style="width: ${task.progress}%;">已完成${task.progress}%</div>
						</div>
						</c:when>
						
						
						
					</c:choose>
					<c:if test="${(sessionScope.employee.name eq map[task.id]) or (role eq 'leader') }">
						 <span ><i class="icon-edit"></i><a href="edittask.jspx?tid=${task.id}">编辑任务</a></span>
					</c:if>
					
                </div>
              </div>
            </div>
				</c:forEach>
			</div>
		</div>
	</div>
</body>
</html>